<script lang="ts">
import { h, defineComponent } from 'vue'

export default defineComponent({
  name: 'Bread',
  setup(props, { slots }) {
    const items = slots.default!()
    const dynamicItem: any[] = []
    items.forEach((item, i) => {
      dynamicItem.push(item)
      if (i < items.length - 1) {
        dynamicItem.push(h('i', { class: 'iconfont icon-angle-right' }))
      }
    })

    return () => h('div', { class: 'bread' }, dynamicItem)
  }
})
</script>
<template></template>

<style lang="less">
.bread {
  display: flex;
  padding: 25px 10px;

  &-item {
    a {
      color: #666;
      transition: all 0.4s;
      &:hover {
        color: @themeColor;
      }
    }
  }
  i {
    font-size: 12px;
    margin-left: 5px;
    margin-right: 5px;
    line-height: 22px;
  }
}
</style>
